package com.dzh.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName product
 */
@TableName(value ="product")
@Data
public class Product implements Serializable {
    /**
     * 产品id
     */
    @TableId(type = IdType.AUTO)
    private Integer pid;

    /**
     * 产品名称
     */
    private String pname;

    /**
     * 利率
     */
    private Long interestrate;

    /**
     * 最小额度
     */
    private Long quantitymin;

    /**
     * 最大额度
     */
    private Long quantitymax;

    /**
     * 还款最大期限
     */
    private Date deadline;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Product other = (Product) that;
        return (this.getPid() == null ? other.getPid() == null : this.getPid().equals(other.getPid()))
            && (this.getPname() == null ? other.getPname() == null : this.getPname().equals(other.getPname()))
            && (this.getInterestrate() == null ? other.getInterestrate() == null : this.getInterestrate().equals(other.getInterestrate()))
            && (this.getQuantitymin() == null ? other.getQuantitymin() == null : this.getQuantitymin().equals(other.getQuantitymin()))
            && (this.getQuantitymax() == null ? other.getQuantitymax() == null : this.getQuantitymax().equals(other.getQuantitymax()))
            && (this.getDeadline() == null ? other.getDeadline() == null : this.getDeadline().equals(other.getDeadline()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPid() == null) ? 0 : getPid().hashCode());
        result = prime * result + ((getPname() == null) ? 0 : getPname().hashCode());
        result = prime * result + ((getInterestrate() == null) ? 0 : getInterestrate().hashCode());
        result = prime * result + ((getQuantitymin() == null) ? 0 : getQuantitymin().hashCode());
        result = prime * result + ((getQuantitymax() == null) ? 0 : getQuantitymax().hashCode());
        result = prime * result + ((getDeadline() == null) ? 0 : getDeadline().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", pid=").append(pid);
        sb.append(", pname=").append(pname);
        sb.append(", interestrate=").append(interestrate);
        sb.append(", quantitymin=").append(quantitymin);
        sb.append(", quantitymax=").append(quantitymax);
        sb.append(", deadline=").append(deadline);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}